package com.huabo.system.oracle.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.system.oracle.entity.TblMonitorIndicatorresult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2022-04-28
 */
public interface TblMonitorIndicatorresultMapper extends BaseMapper<TblMonitorIndicatorresult> {

    @SelectProvider(type=TblMonitorIndicatorresultMapperSqlConfig.class,method="getResultListJKZX")
    List<TblMonitorIndicatorresult> getResultListJKZX(PageInfo<TblMonitorIndicatorresult> pageInfo, BigDecimal indicatorid, BigDecimal solutionresultid);

    @Select("SELECT COUNT(*) FROM TBL_MONITOR_INDICATORRESULT where RESULTID =(select RESULTID from (SELECT RESULTID FROM TBL_MONITOR_INDICATORRESULT WHERE SOLUTIONRESULTID= #{solutionresultid} and INDICATORID= #{indicatorid} and SOURCE=3 order by savetime desc) where rownum =1)")
    Integer getResultListJKZXCount(BigDecimal indicatorid, BigDecimal solutionresultid);

}
